package demo

import (
    "fmt"
    "io/ioutil"

    aepapi "gitee.com/dell_software_department/ctwing_sdk/apis/Aep_subscribe_north"
)

func GetSubscription_Demo() {
    resp, err := aepapi.GetSubscription("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("GetSubscription err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func GetSubscriptionsList_Demo() {
    resp, err := aepapi.GetSubscriptionsList("dFI1lzE0EN2", "xQcjrfNLvQ", "10015488", "", "", "cd35c680b6d647068861f7fd4e79d3f5", "", "")

    if err != nil {
        fmt.Println("GetSubscriptionsList err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func DeleteSubscription_Demo() {
    resp, err := aepapi.DeleteSubscription("dFI1lzE0EN2", "xQcjrfNLvQ", "", "10015488test", "10015488", "", "cd35c680b6d647068861f7fd4e79d3f5")

    if err != nil {
        fmt.Println("DeleteSubscription err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func CreateSubscription_Demo() {
    resp, err := aepapi.CreateSubscription("dFI1lzE0EN2", "xQcjrfNLvQ", "cd35c680b6d647068861f7fd4e79d3f5", "{}")

    if err != nil {
        fmt.Println("CreateSubscription err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
